package cn.luyou.admin.service;

import cn.luyou.admin.entity.TrainingPaper;
import cn.luyou.admin.entity.Question;
import cn.luyou.admin.entity.TrainingPaperQuestion;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

public interface TrainingPaperService extends IService<TrainingPaper> {
    
    // 获取训练试卷列表
    IPage<TrainingPaper> getTrainingPapers(Integer pageNum, Integer pageSize, Long userId);
    
    // 从错题生成训练试卷
    TrainingPaper generateFromWrongQuestions(Long userId, Integer questionCount, String paperName);
    
    // 随机生成训练试卷
    TrainingPaper generateRandomPaper(Long userId, String subject, Integer questionCount);
    
    // 获取训练试卷题目
    List<Question> getTrainingPaperQuestions(Long paperId);
    
    // 提交训练试卷答案
    void submitTrainingPaper(Long paperId, Map<Long, String> answers);
    
    // 获取训练试卷详情
    TrainingPaper getTrainingPaperDetail(Long paperId);

    Map<Long, String> getSavedAnswers(Long id, Long userId);

    List<TrainingPaperQuestion> getPaperResults(Long id);
} 